package com.guohe3.just.common.enums;

/**
 * @author 浦希成
 * 2018-12-31
 */
public enum OriginEnum {
    /**
     * 结果返回状态
     */
    WECHAT_APPLET(1, "小程序"),
    ANDROID(2, "安卓"),
    WEB(3, "网页");

    private Integer code;
    private String name;


    OriginEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getValueByCode(String code) {
        for (OriginEnum platformFree : OriginEnum.values()) {
            if (code.equals(platformFree.getCode() + "")) {
                return platformFree.getName();
            }
        }
        return null;
    }


    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
